#include "hardware_buffer.h"
#include "scene_exception.h"

using namespace krryn::scene;

hardware_buffer::hardware_buffer() : m_Locked(none) {}

void hardware_buffer::lock(lock_type a_Type){
	if(m_Locked == none){
		m_Locked = a_Type;
	}else{
		throw scene_exception("Buffer already locked");
	}
}

void hardware_buffer::unlock(){
	if(m_Locked != none){
		m_Locked = none;
	}else{
		throw scene_exception("Buffer must be locked");
	}
}

lock_type hardware_buffer::locked(){
	return m_Locked;
}